Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo: optimize feature flags of tokio #20

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

dongsupark
Copy link
Member

@dongsupark dongsupark commented Oct 12, 2023

Disable full feature of tokio, instead enable only necessary features, macros, net, rt-multi-thread.
Doing that, build time drops by ~10%.

See also #18.

@dongsupark dongsupark requested review from wrl and pothos October 12, 2023 15:31
@dongsupark dongsupark mentioned this pull request Oct 12, 2023
2 tasks
Disable full feature of tokio, instead enable only necessary features,
macros, net, rt-multi-thread.
Doing that, build time drops by ~10%.
@dongsupark dongsupark force-pushed the dongsu/tokio-slim-features branch from fc210e7 to ae88512 Compare October 13, 2023 07:41
@pothos
Copy link
Member

pothos commented Oct 13, 2023

Sounds ok but I don't know if, e.g., time should also be there for the schedulers to work correctly?

@wrl
Copy link
Collaborator

wrl commented Oct 16, 2023

looks fine to me. do you still want to look into smol to see if it works for our purposes?

@dongsupark
Copy link
Member Author

do you still want to look into smol to see if it works for our purposes?

Yes, I would like to look into smol in the long term.
It seems possible to replace simple code of tokio with smol, at least inside our code base.

The thing is, however, that other libs like reqwest still heavily rely on tokio. The reqwest currently does not support smol. (See seanmonstar/reqwest#1944)
So it is not trivial to get rid of tokio completely.

@dongsupark dongsupark merged commit f0ad33c into trunk Oct 25, 2023
1 check passed
@dongsupark dongsupark deleted the dongsu/tokio-slim-features branch October 25, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants